package question6;

/**
 * 接着定义其子类 Cat
 *
 * @FileName Cat
 * @Description
 * @Author Sword
 * @date 2024-10-11
 **/
public class Cat extends Animal {
    public Cat() {
        super();
    }

    public Cat(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //包含一个成员方法 sleep()
    public void sleep() {
        System.out.println(name + " 在睡觉");
    }

    @Override
    public void speak() {
        System.out.println(name + "猫在说话");
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return this.name;
    }

    public void setAge(int age) {
        this.age = age;
    }


}
